"""Auth-related request/response schemas."""

from __future__ import annotations

from datetime import datetime

from pydantic import BaseModel, EmailStr, Field

from app.schemas.base import CamelModel


class PasswordResetRequest(BaseModel):
    email: EmailStr


class PasswordResetConfirm(BaseModel):
    token: str = Field(min_length=16, max_length=128)
    new_password: str = Field(min_length=8, max_length=128)


class PasswordResetDirect(BaseModel):
    """简化版密码重置: 无邮件确认,直接输入2次新密码."""

    email: EmailStr
    new_password: str = Field(min_length=8, max_length=128, description="新密码")
    confirm_password: str = Field(min_length=8, max_length=128, description="确认新密码")


class TokenRefreshRequest(BaseModel):
    refresh_token: str = Field(min_length=16)


class Message(BaseModel):
    message: str


class TokenPair(CamelModel):
    """Access/refresh token pair for authentication responses.

    Uses camelCase serialization via CamelModel alias generator.
    """

    access_token: str
    refresh_token: str
    expires_at: datetime
